<template>
  <iframe :src="url" frameborder="0" name="showHere" scrolling="auto" height="100%" width="100%" />
</template>

<script>

import { getToken } from '@/utils/auth'

export default {
  props: {
    formId: {
      type: String,
      default: undefined,
      desc: '表单ID/表单生成ID 取决于type save:表单ID update:表单生成ID'
    }
  },
  data() {
    return {
      url: null
    }
  },
  created() {
  },
  mounted() {
    window.token = 'Bearer ' + getToken()
    window.baseUrl = process.env.VUE_APP_BASE_API
    this.url = process.env.BASE_URL + 'magicalcoder/index-element.html?formId=' + this.formId
    // this.url = process.env.BASE_URL + 'magicalcoder/magicalcoder.html?ui=element&formId=704b61ad07264de68e47a4594a236bfb'
    // this.url = process.env.BASE_URL + 'magicalcoder/publish.html'
  },
  methods: {
  }
}
</script>
